package com.sam.chat.api;

/**
 *  @author: sam
 */
public enum ResultCode implements IErrorCode {
    SUCCESS(200, "操作成功"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),
    VALIDATE_FAILED(404, "参数检验失败,请输入在合理范围的数据"),
    FIND_NOT_RESULT(405, "查询不到结果"),
    REQUEST_ILLEGAL(406,"请求非法"),
    IDENTITY_FAILED(407, "身份验证失败,请重新登录"),
    REPEAT_MODIFICATION(408,"重复修改"),
    DISABLE_FUNCTION(409,"此功能已被关闭"),
    ILLEGAL_USER(410,"该用户已禁用"),
    ILLEGAL_PHONE(412,"手机号格式错误"),
    FAILED(500, "操作失败"),
    INDIVIDUAL_REPEAT(601,"申请人已重复"),
    RELATION_USER(99999,"系统错误,请联系管理员"),
    IS_NULL_ERROR(414,"请求参数为空,稍后再试"),
    SQL_ERROR(415,"sql语句存在错误"),
    REQUEST_ERROR(416,"请求方式错误")
    ;


    private long code;
    private String message;

    private ResultCode(long code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public long getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
